package com.thjk.bdf.preloan.service.impl;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.thjk.bdf.common.entity.ApplyOrder;
import com.thjk.bdf.common.page.TableDataInfo;
import com.thjk.bdf.preloan.service.repository.dao.ApplyOrderMapper;
import com.thjk.bdf.service.OrderService;

@RestController
@RequestMapping("/order")
public class OrderServiceImpl implements OrderService{
	
	
	@Autowired
	private ApplyOrderMapper applyOrderMapper;

	@Override
	@RequestMapping(value="/insertApplyOrder",method=RequestMethod.POST)
	public int insertApplyOrder(@RequestBody ApplyOrder applyOrder) {
		return applyOrderMapper.insertSelective(applyOrder);
	}

	@Override
	@RequestMapping(value="/updateApplyOrder",method=RequestMethod.POST)
	public int updateApplyOrder(@RequestBody ApplyOrder applyOrder) {
		return applyOrderMapper.updateByPrimaryKeySelective(applyOrder);
	}

	@Override
	@RequestMapping(value="/selectOrder",method=RequestMethod.POST)
	public ApplyOrder selectOrder(@RequestBody ApplyOrder applyOrder) {
		
		return applyOrderMapper.selectByOrder(applyOrder);
	}

	@Override
	@RequestMapping(value="/selectByPage",method=RequestMethod.POST)
	public TableDataInfo selectByPage(@RequestBody ApplyOrder applyOrder) {
		
		return null;
	}

	@Override
	@RequestMapping(value="/selectByPhone",method=RequestMethod.POST)
	public List<ApplyOrder> selectByPhone(String registerPhone) {
		// TODO Auto-generated method stub
		return applyOrderMapper.selectByPhone(registerPhone);
	}

}
